package com.cwm.test.factory.simpleFactory;

import java.lang.reflect.InvocationTargetException;

public class CourseFactory {

    public ICourse create(Class<? extends ICourse> classz) {
        ICourse course = null;
        try {
            course = classz.getDeclaredConstructor().newInstance();
        } catch (InstantiationException e) {
            e.printStackTrace();
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        } catch (InvocationTargetException e) {
            e.printStackTrace();
        } catch (NoSuchMethodException e) {
            e.printStackTrace();
        }
        return course;
    }
}
